<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * APP通知公告表 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\Notice.name", default="fa_notice"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\Notice.poolName"))
 * @DDL(sql="CREATE TABLE `fa_notice` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '公告ID',
  `name` varchar(50) NOT NULL COMMENT '标题',
  `notice_status` enum('1','2') NOT NULL DEFAULT '2' COMMENT '公告类型:1=店铺,2=用户',
  `image` varchar(255) DEFAULT NULL COMMENT '图片',
  `content` longblob COMMENT '公告内容',
  `status` enum('0','1') NOT NULL DEFAULT '1' COMMENT '公告状态:0=关闭,1=正常',
  `views` int(10) unsigned DEFAULT '0' COMMENT '浏览量',
  `ps` varchar(255) DEFAULT NULL COMMENT '备注',
  `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
  `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
  `createtime` int(10) unsigned DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
  `deletetime` int(10) unsigned DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='APP通知公告表'", decode="")
 *
 * @property int|null $id 公告ID
 * @property string|null $name 标题
 * @property string|null $noticeStatus 公告类型:1=店铺,2=用户
 * @property string|null $image 图片
 * @property string|null $content 公告内容
 * @property string|null $status 公告状态:0=关闭,1=正常
 * @property int|null $views 浏览量
 * @property string|null $ps 备注
 * @property string|null $creator 创建者
 * @property string|null $updater 更新者
 * @property int|null $createtime 创建时间
 * @property int|null $updatetime 更新时间
 * @property int|null $deletetime 删除时间
 */
abstract class NoticeBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * 公告ID.
     * id
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id - 公告ID.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id - 公告ID.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 标题.
     * name
     * @Column(name="name", type="varchar", length=50, accuracy=0, nullable=false, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $name = NULL;

    /**
     * 获取 name - 标题.
     *
     * @return string|null
     */
    public function getName(): ?string
    {
        return $this->name;
    }

    /**
     * 赋值 name - 标题.
     * @param string|null $name name
     * @return static
     */
    public function setName($name)
    {
        $this->name = null === $name ? null : (string)$name;
        return $this;
    }

    /**
     * 公告类型:1=店铺,2=用户.
     * notice_status
     * @Column(name="notice_status", type="enum", length=0, accuracy=0, nullable=false, default="2", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $noticeStatus = '2';

    /**
     * 获取 noticeStatus - 公告类型:1=店铺,2=用户.
     *
     * @return string|null
     */
    public function getNoticeStatus(): ?string
    {
        return $this->noticeStatus;
    }

    /**
     * 赋值 noticeStatus - 公告类型:1=店铺,2=用户.
     * @param string|null $noticeStatus notice_status
     * @return static
     */
    public function setNoticeStatus($noticeStatus)
    {
        $this->noticeStatus = null === $noticeStatus ? null : (string)$noticeStatus;
        return $this;
    }

    /**
     * 图片.
     * image
     * @Column(name="image", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $image = NULL;

    /**
     * 获取 image - 图片.
     *
     * @return string|null
     */
    public function getImage(): ?string
    {
        return $this->image;
    }

    /**
     * 赋值 image - 图片.
     * @param string|null $image image
     * @return static
     */
    public function setImage($image)
    {
        $this->image = null === $image ? null : (string)$image;
        return $this;
    }

    /**
     * 公告内容.
     * content
     * @Column(name="content", type="longblob", length=0, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $content = NULL;

    /**
     * 获取 content - 公告内容.
     *
     * @return string|null
     */
    public function getContent(): ?string
    {
        return $this->content;
    }

    /**
     * 赋值 content - 公告内容.
     * @param string|null $content content
     * @return static
     */
    public function setContent($content)
    {
        $this->content = null === $content ? null : (string)$content;
        return $this;
    }

    /**
     * 公告状态:0=关闭,1=正常.
     * status
     * @Column(name="status", type="enum", length=0, accuracy=0, nullable=false, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $status = '1';

    /**
     * 获取 status - 公告状态:0=关闭,1=正常.
     *
     * @return string|null
     */
    public function getStatus(): ?string
    {
        return $this->status;
    }

    /**
     * 赋值 status - 公告状态:0=关闭,1=正常.
     * @param string|null $status status
     * @return static
     */
    public function setStatus($status)
    {
        $this->status = null === $status ? null : (string)$status;
        return $this;
    }

    /**
     * 浏览量.
     * views
     * @Column(name="views", type="int", length=10, accuracy=0, nullable=true, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $views = 0;

    /**
     * 获取 views - 浏览量.
     *
     * @return int|null
     */
    public function getViews(): ?int
    {
        return $this->views;
    }

    /**
     * 赋值 views - 浏览量.
     * @param int|null $views views
     * @return static
     */
    public function setViews($views)
    {
        $this->views = null === $views ? null : (int)$views;
        return $this;
    }

    /**
     * 备注.
     * ps
     * @Column(name="ps", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $ps = NULL;

    /**
     * 获取 ps - 备注.
     *
     * @return string|null
     */
    public function getPs(): ?string
    {
        return $this->ps;
    }

    /**
     * 赋值 ps - 备注.
     * @param string|null $ps ps
     * @return static
     */
    public function setPs($ps)
    {
        $this->ps = null === $ps ? null : (string)$ps;
        return $this;
    }

    /**
     * 创建者.
     * creator
     * @Column(name="creator", type="varchar", length=64, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $creator = '';

    /**
     * 获取 creator - 创建者.
     *
     * @return string|null
     */
    public function getCreator(): ?string
    {
        return $this->creator;
    }

    /**
     * 赋值 creator - 创建者.
     * @param string|null $creator creator
     * @return static
     */
    public function setCreator($creator)
    {
        $this->creator = null === $creator ? null : (string)$creator;
        return $this;
    }

    /**
     * 更新者.
     * updater
     * @Column(name="updater", type="varchar", length=64, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $updater = '';

    /**
     * 获取 updater - 更新者.
     *
     * @return string|null
     */
    public function getUpdater(): ?string
    {
        return $this->updater;
    }

    /**
     * 赋值 updater - 更新者.
     * @param string|null $updater updater
     * @return static
     */
    public function setUpdater($updater)
    {
        $this->updater = null === $updater ? null : (string)$updater;
        return $this;
    }

    /**
     * 创建时间.
     * createtime
     * @Column(name="createtime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $createtime = NULL;

    /**
     * 获取 createtime - 创建时间.
     *
     * @return int|null
     */
    public function getCreatetime(): ?int
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 创建时间.
     * @param int|null $createtime createtime
     * @return static
     */
    public function setCreatetime($createtime)
    {
        $this->createtime = null === $createtime ? null : (int)$createtime;
        return $this;
    }

    /**
     * 更新时间.
     * updatetime
     * @Column(name="updatetime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $updatetime = NULL;

    /**
     * 获取 updatetime - 更新时间.
     *
     * @return int|null
     */
    public function getUpdatetime(): ?int
    {
        return $this->updatetime;
    }

    /**
     * 赋值 updatetime - 更新时间.
     * @param int|null $updatetime updatetime
     * @return static
     */
    public function setUpdatetime($updatetime)
    {
        $this->updatetime = null === $updatetime ? null : (int)$updatetime;
        return $this;
    }

    /**
     * 删除时间.
     * deletetime
     * @Column(name="deletetime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $deletetime = NULL;

    /**
     * 获取 deletetime - 删除时间.
     *
     * @return int|null
     */
    public function getDeletetime(): ?int
    {
        return $this->deletetime;
    }

    /**
     * 赋值 deletetime - 删除时间.
     * @param int|null $deletetime deletetime
     * @return static
     */
    public function setDeletetime($deletetime)
    {
        $this->deletetime = null === $deletetime ? null : (int)$deletetime;
        return $this;
    }

}
